﻿//-----------------------------------------------------------------------------
//
//
//
//-----------------------------------------------------------------------------
// Exo² - Tools - Studio/ExefBuilderModule
// Copyright (C) 2007-2008 Samuel Lacroix and Raphaël Legouge
//
// Distributed under GNU General Public License
// See the License folder for details
// http://www.codeplex.com/exo2 (eng)
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ExefBuilderModule
{
        public partial class ChooseDefaultPhysiology : Form
        {
                public ChooseDefaultPhysiology()
                {
                        InitializeComponent();
                }
                
                public void ResetForm(string[] physiologyNames)
                {
                        this.comboBox1.Items.Clear();
                        this.comboBox1.Items.AddRange(physiologyNames);
                        this.comboBox1.Text = this.comboBox1.Items[0].ToString();
                }

                private void button1_Click(object sender, EventArgs e)
                {
                        if (this.comboBox1.Items.IndexOf(this.comboBox1.Text) >= 0)
                            this.DialogResult = DialogResult.OK;
                        else
                            MessageBox.Show("you have to choose a physiology name.");
                }

                private void button2_Click(object sender, EventArgs e)
                {
                        this.DialogResult = DialogResult.Cancel;
                }
                
                public string getDefaultPhysiologyName()
                {
                        return this.comboBox1.Text;
                }

        }
}
